package DBTasks;

import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

public class ShelterList extends DBTask{

	private static ArrayList<String> shelters;

	public static ArrayList<String> listShelters(){
		Statement shelterStatement;
		try {
			shelterStatement = con.createStatement();
			ResultSet rsShelter = shelterStatement.executeQuery("select Name from Shelter");
		    
			shelters = new ArrayList<String>();
			
		    while(rsShelter.next()){
				shelters.add(rsShelter.getString(1));
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return shelters;

	}
 
}
